/**
 * 
 */
package com.dfhc.pub.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.ui.Model;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import bsh.EvalError;

import com.dfhc.bus.generalservice.vo.GeneralServiceVo;

/**
 * 通用业务扩展接口，
 *  
 * @author longsebo
 */
public interface IExtGeneralService {

	/**
	 * 模拟bean shell保存业务数据
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> doSaveBusinessData(HttpServletRequest request, HttpServletResponse response) throws Exception;

	/**
	 * 模拟bean shell脚本 写入业务数据 以及文件数据
	 * @param request
	 * @param response
	 * @param listFile   文件
	 * @throws Exception 
	 */
	public Map<String, Object> doSaveBusinessDataAndFiles(HttpServletRequest request, HttpServletResponse response,GeneralServiceVo  vo,List listFile) throws Exception;

	/**
	 * 模拟bean shell脚本 写入任务数据
	 * @param request
	 * @param response
	 * @return
	 * @throws EvalError
	 */
	public Map<String, Object> doSaveTaskData(HttpServletRequest request, HttpServletResponse response) throws EvalError;

	/**
	 * 导出xls并下载
	 * @param request
	 * @param response
	 */
	public void exportXls(HttpServletRequest request,
			HttpServletResponse response);

	/**
	 * 模拟bean shell脚本读取业务数据
	 * @param request
	 * @return
	 */
	public Map<String, Object> getBusinessData(String  id,String businessTableName,HttpServletRequest request);

	/**
	 * 模拟bean shell脚本读取业务数据
	 * @param request
	 * @return
	 */
	public Map<String, Object> readBusinessData(HttpServletRequest request);

	/**
	 * 模拟bean shell脚本 读取任务数据
	 * @param request
	 * @return
	 */
	public Map<String, Object> readTaskData(HttpServletRequest request);
	/**
	 * ajax查询列表
	 * @param model
	 * @param request
	 * @param response
	 * @throws IOException 
	 */
	public void ajaxList(Model model, HttpServletRequest request,HttpServletResponse response) throws IOException;
	/**
	 * ajax插入
	 * @param request
	 * @param vo
	 * @return
	 */
	public Map<String, Object> doAjaxInsert(HttpServletRequest request,
			GeneralServiceVo vo);
	/**
	 * ajax更新
	 * @param request
	 * @param vo
	 * @return
	 */
	public Map<String, Object> doAjaxUpdate(HttpServletRequest request,
			GeneralServiceVo vo);
	/**
	 * ajax查询单条记录
	 * @param request
	 * @param vo
	 * @return
	 */
	public Map<String, Object> ajaxGet(String id, String businessTableName,
			HttpServletRequest request);
	/**
	 * 删除
	 * @param request
	 * @param redirectAttributes
	 * @return
	 */
	public String delete(HttpServletRequest request,
			RedirectAttributes redirectAttributes);
	/**
	 * ajax删除
	 * @param request
	 * @return
	 */
	public Map<String, Object> doAjaxDelete(HttpServletRequest request);
	/**
	 * 逻辑删除
	 * @param request
	 * @param redirectAttributes
	 * @return
	 */
	public String doLogicDelete(HttpServletRequest request,
			RedirectAttributes redirectAttributes);
	/**
	 * 查看详细页面
	 * @param id
	 * @param model
	 * @param request
	 * @return
	 */
	public String detail(String id, Model model, HttpServletRequest request);
	/**
	 * 导出xls
	 * @param model
	 * @param request
	 * @param response
	 */
	public void exportXls(Model model, HttpServletRequest request,
			HttpServletResponse response);
	/**
	 * 导入xls
	 * @param request
	 * @param response
	 */
	public void importXls(HttpServletRequest request,
			HttpServletResponse response);

}
